<!-- 村列表中的区域筛选 -->
<div class="col-md-10">
    <form id="searchForm" action="{$pageSize.url}" class="form" method="post">
        <div class="form-inline">
            {if condition="($admin->type == 3) OR ($admin->type == 6)"}
            {$selectarea['cityname']}->{$selectarea['xianname']}->{$selectarea['townname']}
            {if !$selectarea['villagename']}
                <select id="village" name="villageId" class="form-control"  ></select>
            {/if}
            {elseif condition="($admin->type == 4)"}
            {$selectarea['cityname']}->{$selectarea['xianname']}->{$selectarea['townname']}->{$selectarea['villagename']}
            {elseif condition="($admin->type == 2)"}
            {$selectarea['cityname']}->{$selectarea['xianname']}
            <select id="town" name="townId" class="form-control" data-hasvillage="on" ></select>
            <select id="village" name="villageId" class="form-control"  ></select>
            {elseif condition="($admin->type == 1)"}
            {$selectarea['cityname']}
            <select id="xian" name="xianId" class="form-control" ></select>
            <select id="town" name="townId" class="form-control" data-hasvillage="on" ></select>
            <select id="village" name="villageId" class="form-control"  ></select>
            {else/}
            <select id="city" name="cityId" class="form-control" ></select>
            <select id="xian" name="xianId" class="form-control" ></select>
            <select id="town" name="townId" class="form-control" data-hasvillage="on" ></select>
            <select id="village" name="villageId" class="form-control"  ></select>
            {/if}

            <input type="hidden" class="form-control city" name="city" value="{$selectarea['cityname']}">
            <input type="hidden" class="form-control xian" name="xian" value="{$selectarea['xianname']}">
            <input type="hidden" class="form-control town" name="town" value="{$selectarea['townname']}">
            <input type="hidden" class="form-control village" name="village" value="{$selectarea['villagename']}">

            &nbsp;&nbsp;&nbsp;
            {notempty name="searchFields"}
                {foreach $searchFields as $search}
                    {notempty name="search.label"}
                        {/*{php}include(APP_PATH . "admin/view/components/" . $search['type'] . ".html");{/php}*/}
                        {switch name="search.type" }
                            {case value="text"}
                                {include file="components:text" /}
                            {/case}
                            {case value="select"}
                                {include file="components:select" /}
                            {/case}
                            {case value="date"}
                                {include file="components:date" /}
                            {/case}
                                {default /}
                                {include file="components:text" /}
                        {/switch}
                        &nbsp;&nbsp;&nbsp;
                    {/notempty}
                {/foreach}
            {/notempty}

            <button id="doSearch" type="button" class="btn btn-success" title="筛选">
                <i class="fa fa-search"></i> 筛选
            </button>
            <!--<a href="{$currentUrl}?reset=1" class="btn btn-danger"><i class="fa fa-trash"></i> 清空</a>-->
            <button type="reset" class="btn btn-danger" title="清空">
                <i class="fa fa-trash"></i> 清空
            </button>
        </div>
    </form>
</div>

<input type="hidden" class="getregion_url" value="{:url('admin/region/getregion')}">
<input type="hidden" class="getvillage_url" value="{:url('admin/region/getvillage')}">
<input type="hidden" class="adminType" value="{$admin.type}">
<input type="hidden" class="adminCity" value="{$admin.cityId}">
<input type="hidden" class="adminXian" value="{$admin.xianId}">
<input type="hidden" class="adminTown" value="{$admin.townId}">
<input type="hidden" class="adminVillage" value="{$admin.villageId}">

<script src="__STATIC__/admin/pages/js/searcharea.js" type="text/javascript"></script>
